package com.bh.springbootjdk17demo.controller;

import com.bh.springbootjdk17demo.config.MyWebSocketHandler;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WebSocketController {

    @PostMapping("/send")
    public String sendMessage(@RequestParam String message) {
        MyWebSocketHandler.sendMessageToAll(message);
        return "Message sent!";
    }
}
